package com.yanqu.road.entity.activity.youxing;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.property.Property;

import java.util.List;
import java.util.Map;
import java.util.Objects;

@FieldTypeAnnotation(tableName = "t_c_xing_you_team_data", desc = "行游山水-队伍数据")
public class CrossXingYouShanShuiTeamData extends DataObject {

    @FieldTypeAnnotation(select = true, update = true, desc = "活动ID")
    private int activityId;

    @FieldTypeAnnotation(update = true, desc = "分组id")
    private int groupId;

    @FieldTypeAnnotation(update = true, desc = "队伍ID")
    private int teamId;

    @FieldTypeAnnotation(desc = "银票")
    private long silverCoin;

    @FieldTypeAnnotation(desc = "累计获得银票")
    private long silverCoinTotal;

    @FieldTypeAnnotation(desc = "累计获得银票-更新时间")
    private long silverUpdateTime;

    @FieldTypeAnnotation(desc = "今日漂泊过的队伍")
    private List<Integer> todayTeam;

    @FieldTypeAnnotation(desc = "今日待漂泊的队伍-提前随机")
    private List<Integer> randomTodayTeam;

    @FieldTypeAnnotation(desc = "漂泊来的其他队伍成员")
    private Map<Long, Long> visitorMap;

    @FieldTypeAnnotation(desc = "总消耗体力")
    private int useEnergy;

    @FieldTypeAnnotation(desc = "队长id")
    private long masterId;

    @FieldTypeAnnotation(desc = "祈愿进度")
    private int wishValue;

    @FieldTypeAnnotation(desc = "大佛赐福次数")
    private int bigWishTimes;

    @FieldTypeAnnotation(desc = "祈愿轮次")
    private int wishRound;

    @FieldTypeAnnotation(desc = "捕快位置")
    private List<Integer> captorList;

    @FieldTypeAnnotation(desc = "捕快收益")
    private Property captorReward;

    @FieldTypeAnnotation(desc = "妈祖庙-宣言")
    private String declaration = "";


    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        if(this.groupId != groupId) {
            this.groupId = groupId;
            setUpdateOption();
        }
    }

    public int getTeamId() {
        return teamId;
    }

    public void setTeamId(int teamId) {
        if(this.teamId != teamId) {
            this.teamId = teamId;
            setUpdateOption();
        }
    }

    public long getSilverCoin() {
        return silverCoin;
    }

    public void setSilverCoin(long silverCoin) {
        if(this.silverCoin != silverCoin) {
            this.silverCoin = silverCoin;
            setUpdateOption();
        }
    }

    public long getSilverCoinTotal() {
        return silverCoinTotal;
    }

    public void setSilverCoinTotal(long silverCoinTotal) {
        if(this.silverCoinTotal != silverCoinTotal) {
            this.silverCoinTotal = silverCoinTotal;
            setUpdateOption();
        }
    }

    public long getSilverUpdateTime() {
        return silverUpdateTime;
    }

    public void setSilverUpdateTime(long silverUpdateTime) {
        if(this.silverUpdateTime != silverUpdateTime) {
            this.silverUpdateTime = silverUpdateTime;
            setUpdateOption();
        }
    }

    public List<Integer> getTodayTeam() {
        return todayTeam;
    }

    public void setTodayTeam(List<Integer> todayTeam) {
        this.todayTeam = todayTeam;
        setUpdateOption();
    }

    public int getUseEnergy() {
        return useEnergy;
    }

    public void setUseEnergy(int useEnergy) {
        if(this.useEnergy != useEnergy) {
            this.useEnergy = useEnergy;
            setUpdateOption();
        }
    }

    public long getMasterId() {
        return masterId;
    }

    public void setMasterId(long masterId) {
        if(this.masterId != masterId) {
            this.masterId = masterId;
            setUpdateOption();
        }
    }

    public List<Integer> getRandomTodayTeam() {
        return randomTodayTeam;
    }

    public void setRandomTodayTeam(List<Integer> randomTodayTeam) {
        this.randomTodayTeam = randomTodayTeam;
        setUpdateOption();
    }

    public Map<Long, Long> getVisitorMap() {
        return visitorMap;
    }

    public void setVisitorMap(Map<Long, Long> visitorMap) {
        this.visitorMap = visitorMap;
        setUpdateOption();
    }

    public List<Integer> getCaptorList() {
        return captorList;
    }

    public void setCaptorList(List<Integer> captorList) {
        this.captorList = captorList;
        setUpdateOption();
    }

    public int getWishValue() {
        return wishValue;
    }

    public void setWishValue(int wishValue) {
        if(this.wishValue != wishValue) {
            this.wishValue = wishValue;
            setUpdateOption();
        }
    }

    public int getWishRound() {
        return wishRound;
    }

    public void setWishRound(int wishRound) {
        if(this.wishRound != wishRound) {
            this.wishRound = wishRound;
            setUpdateOption();
        }
    }


    public Property getCaptorReward() {
        return captorReward;
    }

    public void setCaptorReward(Property captorReward) {
        this.captorReward = captorReward;
        setUpdateOption();
    }


    public String getDeclaration() {
        return declaration;
    }

    public void setDeclaration(String declaration) {
        if(!Objects.equals(this.declaration, declaration)) {
            this.declaration = declaration;
            setUpdateOption();
        }
    }

    public int getBigWishTimes() {
        return bigWishTimes;
    }

    public void setBigWishTimes(int bigWishTimes) {
        this.bigWishTimes = bigWishTimes;
    }

    public void addTodayTeam(int teamId){
        if(!todayTeam.contains(teamId)){
            todayTeam.add(teamId);
            setUpdateOption();
        }
    }
}
